import { useState, useEffect} from "react";
import { StyleSheet, ActivityIndicator, View,Text} from "react-native";

const Toast = ({message,visible}:{message:string,visible:boolean}) => {
  
  useEffect(() => {
  }, []);
  return (
    <>
        {visible && 
        <View style={styles.container}>
            <Text style={styles.message}>{message}</Text>
        </View>}
    </>
  )
};

export default Toast;

const styles = StyleSheet.create({
    container: { 
        position: 'absolute', 
        top: '20%', 
        left: 0, 
        right: 0, 
        alignItems: 'center',
        justifyContent: 'center',
        padding: 15 
    },
    message: {
        padding: 15,
        backgroundColor: 'rgba(0,0,0,0.7)',
        color: '#fff',
        fontSize: 18,
        textAlign: 'center',
        borderRadius: 8
    }
  });
